package com.sc.byahi.user.client.components.maps;

import com.google.gwt.ajaxloader.client.Properties;
import com.google.gwt.ajaxloader.client.Properties.TypeException;
import com.google.gwt.core.client.GWT;
import com.google.gwt.place.shared.PlaceChangeEvent;
import com.sc.byahi.user.client.components.maps.places.PlaceChangeMapEvent;
import com.sc.byahi.user.client.components.maps.places.PlaceChangeMapHandler;

public class MClickHandlerRegistration {

	protected static void onCallback(MClickHandler handler, Properties event) {
		GWT.log("Map click returned." + event);
		try {
			LatLng l = (LatLng)event.getObject("latLng").cast();
			GWT.log("Map click returned." + l.toString());
		} catch (TypeException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		MClickEvent mapClickEvent = new MClickEvent(event);
		handler.onEvent(mapClickEvent);
	}
}
